package eteam.aps.systeminterface.model.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;

import javax.validation.GroupSequence;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @description : 字典表Dto
 */
@Data
@ApiModel(value = "字典表")
@GroupSequence({Insert.class, Update.class, DictionaryDto.class})
public class DictionaryDto implements Serializable {
    /**
     * 主键ID
     */
    @ApiModelProperty("主键ID")
    @NotNull(message = "主键ID为空", groups = {Update.class})
    public Long fdicid;
    /**
     * 字典类型
     */
    @ApiModelProperty("字典类型")
    @NotBlank(message = "字典类型为空", groups = {Insert.class, Update.class})
    public String fclass;
    /**
     * 编码
     */
    @ApiModelProperty("编码")
    @NotBlank(message = "编码为空", groups = {Insert.class, Update.class})
    public String fcode;
    /**
     * 名称
     */
    @ApiModelProperty("名称")
    @NotBlank(message = "名称为空", groups = {Insert.class, Update.class})
    public String fname;
    /**
     * 备注
     */
    @ApiModelProperty("备注")
    public String fremark;
    /**
     * 状态【-1删除 0停用 1启用】
     */
    @ApiModelProperty("状态【-1删除 0停用 1启用】")
    @NotNull(message = "状态不合法", groups = {Insert.class, Update.class})
    @Max(value = 1, message = "状态不合法", groups = {Insert.class, Update.class})
    @Min(value = -1, message = "状态不合法", groups = {Insert.class, Update.class})
    public Integer state;
    @ApiModelProperty("排序")
    @NotNull(message = "排序不合法", groups = {Insert.class, Update.class})
    public Integer sort;
}
